To edit scripts and macros, you can use the Settings menu. (You must have the Full Menus preference set.) If you give either the "Macros" or the "Scripts" command, a list of the existing scripts or macros will appear in its own window.
From this window, you can open existing scripts or macros with the "Open" button. A text editing window will appear, showing the contents of the script or macro.
When you save the window, using the File menu's Save command, the new script or macro will be saved to TOPS Terminal Memory. You can also use the Save As command to change the name of the script or macro.
Before trying to write scripts and macros of your own, it would be a good idea to open up a few of the existing ones to see what's going on.
Scripts look like lists of questions and answers. The questions are what TOPS Terminal should expect to receive from the other computer. The answers are what TOPS Terminal will say when it notices that it's been asked one of the questions.
The questions consist of patterns; the answers consist of text to send mixed with special commands.
Here is an example, the script used to identify you to a UNIX computer.
Question: *login:
Answer: (user name)(cr)
Question: Password:
Answer: (password)
Question: Login incorrect
Answer: (retry 3)
Question: *
Answer: (success)
This script looks for any data matching the pattern "*login: "; when it sees that, it sends an answer consisting of the user name on the account.
Then when it sees "Password: ", it sends the account password.
It it sees "Login incorrect", then it tries again up to three times.
However, seeing anything but "Login incorrect" after sending the password tells TOPS Terminal that it has succeeded in identifying you to the UNIX computer.
Four built-in commands are invoked in this script, (user name), (cr), (password), and (retry 3). A built-in command is distinguished by parentheses; the built-ins are listed fully under "Built-Ins for S&M".
One special character was used in the questions, an asterisk. The asterisk, "*", matches anything except the end of a line. The reason the pattern is "*login: " rather than just "login: " is that UNIX computers often identify themselves before saying "login". For instance, the login prompt at the UNIX computer called "suntops" is "suntops login: ".
There are two other special pattern characters, the vertical bar and the backslash. The vertical bar, "|", signifies alternate patterns. The pattern "platypus|wombat" would match either "platypus" or "wombat". The backslash matches an end of line; the pattern "OK\" would only match an "OK" that came at the end of a line.